n=int(input())
if(n % 2 == 0):
    cout << "Wrong number"
else:
    a = [[0 for i in range(n)]for j in range(n)]
    j = int(n/2)
    i = 0
    u = 2
    a[i][j] = 1
    while(u != n*n+1):
        i-=1
        j+=1
        if(i < 0 and j >= n):
            i += 2
            j -= 1
        elif(i < 0) :
            i = n-1
        elif(j >= n):
            j = 0
        elif(a[i][j] > 0):
            i += 2
            j-=1
        a[i][j] = u
        u+=1
    for i1 in range(n):
        for j1 in range(n):
            print("%4d" % a[i1][j1],end='')
        print()